package edu.sctu.fengleilin.month06.day150602.RailWayStation;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Random;

/**
 * Created by user09 on 2015/6/9.
 */
public class IPTimeStamp {
    public void IPTimeStamp() {
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String timein = simpleDateFormat.format(date);
        System.out.println("进站时间：" + timein);

        Date times = null;
        try {
            times = simpleDateFormat.parse(timein);
        } catch (ParseException e) {
            e.printStackTrace();
        }

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(times);
        calendar.add(calendar.MINUTE, 5);
        times=calendar.getTime();
        String timeout = simpleDateFormat.format(times);
        System.out.println("出战时间：" + timeout);
    }

    public static void main(String[] args) {
        IPTimeStamp ipTimeStamp = new IPTimeStamp();
        ipTimeStamp.IPTimeStamp();
    }
}